import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/task/process_currency_arrange_entity.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/process_list_entity.dart';

import 'package:enterprise_v6_app/app/data/entities/application/special_list/process_nodes_entity.dart';


ProcessCurrencyArrangeEntity $ProcessCurrencyArrangeEntityFromJson(Map<String, dynamic> json) {
  final ProcessCurrencyArrangeEntity processCurrencyArrangeEntity = ProcessCurrencyArrangeEntity();
  final String? checkRecordId = jsonConvert.convert<String>(json['checkRecordId']);
  if (checkRecordId != null) {
    processCurrencyArrangeEntity.checkRecordId = checkRecordId;
  }
  final List<String>? dangerImages = (json['dangerImages'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (dangerImages != null) {
    processCurrencyArrangeEntity.dangerImages = dangerImages;
  }
  final String? dangerRecordDesc = jsonConvert.convert<String>(json['dangerRecordDesc']);
  if (dangerRecordDesc != null) {
    processCurrencyArrangeEntity.dangerRecordDesc = dangerRecordDesc;
  }
  final List<String>? dangerVideo = (json['dangerVideo'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (dangerVideo != null) {
    processCurrencyArrangeEntity.dangerVideo = dangerVideo;
  }
  final List<String>? dangerVoice = (json['dangerVoice'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (dangerVoice != null) {
    processCurrencyArrangeEntity.dangerVoice = dangerVoice;
  }
  final List<ProcessNodesEntity>? processNodes = (json['processNodes'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ProcessNodesEntity>(e) as ProcessNodesEntity).toList();
  if (processNodes != null) {
    processCurrencyArrangeEntity.processNodes = processNodes;
  }
  final String? isInspection = jsonConvert.convert<String>(json['isInspection']);
  if (isInspection != null) {
    processCurrencyArrangeEntity.isInspection = isInspection;
  }
  final String? confirmBy = jsonConvert.convert<String>(json['confirmBy']);
  if (confirmBy != null) {
    processCurrencyArrangeEntity.confirmBy = confirmBy;
  }
  final String? confirmUserId = jsonConvert.convert<String>(json['confirmUserId']);
  if (confirmUserId != null) {
    processCurrencyArrangeEntity.confirmUserId = confirmUserId;
  }
  final String? riskObjectName = jsonConvert.convert<String>(json['riskObjectName']);
  if (riskObjectName != null) {
    processCurrencyArrangeEntity.riskObjectName = riskObjectName;
  }
  final String? riskEventId = jsonConvert.convert<String>(json['riskEventId']);
  if (riskEventId != null) {
    processCurrencyArrangeEntity.riskEventId = riskEventId;
  }
  final String? riskMeasureId = jsonConvert.convert<String>(json['riskMeasureId']);
  if (riskMeasureId != null) {
    processCurrencyArrangeEntity.riskMeasureId = riskMeasureId;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    processCurrencyArrangeEntity.riskObjectId = riskObjectId;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    processCurrencyArrangeEntity.riskUnitName = riskUnitName;
  }
  final String? riskTaskId = jsonConvert.convert<String>(json['riskTaskId']);
  if (riskTaskId != null) {
    processCurrencyArrangeEntity.riskTaskId = riskTaskId;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    processCurrencyArrangeEntity.riskUnitId = riskUnitId;
  }
  final ProcessListEntity? rtCertificateField = jsonConvert.convert<ProcessListEntity>(json['rtCertificateField']);
  if (rtCertificateField != null) {
    processCurrencyArrangeEntity.rtCertificateField = rtCertificateField;
  }
  return processCurrencyArrangeEntity;
}

Map<String, dynamic> $ProcessCurrencyArrangeEntityToJson(ProcessCurrencyArrangeEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['checkRecordId'] = entity.checkRecordId;
  data['dangerImages'] = entity.dangerImages;
  data['dangerRecordDesc'] = entity.dangerRecordDesc;
  data['dangerVideo'] = entity.dangerVideo;
  data['dangerVoice'] = entity.dangerVoice;
  data['processNodes'] = entity.processNodes?.map((v) => v.toJson()).toList();
  data['isInspection'] = entity.isInspection;
  data['confirmBy'] = entity.confirmBy;
  data['confirmUserId'] = entity.confirmUserId;
  data['riskObjectName'] = entity.riskObjectName;
  data['riskEventId'] = entity.riskEventId;
  data['riskMeasureId'] = entity.riskMeasureId;
  data['riskObjectId'] = entity.riskObjectId;
  data['riskUnitName'] = entity.riskUnitName;
  data['riskTaskId'] = entity.riskTaskId;
  data['riskUnitId'] = entity.riskUnitId;
  data['rtCertificateField'] = entity.rtCertificateField?.toJson();
  return data;
}

extension ProcessCurrencyArrangeEntityExtension on ProcessCurrencyArrangeEntity {
  ProcessCurrencyArrangeEntity copyWith({
    String? checkRecordId,
    List<String>? dangerImages,
    String? dangerRecordDesc,
    List<String>? dangerVideo,
    List<String>? dangerVoice,
    List<ProcessNodesEntity>? processNodes,
    String? isInspection,
    String? confirmBy,
    String? confirmUserId,
    String? riskObjectName,
    String? riskEventId,
    String? riskMeasureId,
    String? riskObjectId,
    String? riskUnitName,
    String? riskTaskId,
    String? riskUnitId,
    ProcessListEntity? rtCertificateField,
  }) {
    return ProcessCurrencyArrangeEntity()
      ..checkRecordId = checkRecordId ?? this.checkRecordId
      ..dangerImages = dangerImages ?? this.dangerImages
      ..dangerRecordDesc = dangerRecordDesc ?? this.dangerRecordDesc
      ..dangerVideo = dangerVideo ?? this.dangerVideo
      ..dangerVoice = dangerVoice ?? this.dangerVoice
      ..processNodes = processNodes ?? this.processNodes
      ..isInspection = isInspection ?? this.isInspection
      ..confirmBy = confirmBy ?? this.confirmBy
      ..confirmUserId = confirmUserId ?? this.confirmUserId
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..riskEventId = riskEventId ?? this.riskEventId
      ..riskMeasureId = riskMeasureId ?? this.riskMeasureId
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..riskTaskId = riskTaskId ?? this.riskTaskId
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..rtCertificateField = rtCertificateField ?? this.rtCertificateField;
  }
}
